package com.aabte.design2.creational.builder;

/**
 * 客户端代码会创建生成器对象并将其传递给主管，然后执行构造过程。最终结果
 * 将需要从生成器对象中获取。
 *
 * @author Daniel
 * @version 1.0
 * @date 2020/5/2
 */
public class Application {

    public static void main(String[] args) {
        Director director = new Director();

        CarBuilder carBuilder = new CarBuilder();
        director.setBuilder(carBuilder);
        director.constructSportsCar();
        Car car = carBuilder.build();
        System.out.println("car = " + car);

        CarManualBuilder manualBuilder = new CarManualBuilder();
        director.setBuilder(manualBuilder);
        director.constructSportsCar();
        Manual manual = manualBuilder.build();
        System.out.println("manual = " + manual);
    }

}
